<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/jsp/taglib.jsp"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<%@ include file="/jsp/head.jsp"%>
 
	<link rel="stylesheet" href="${ctx}/assets/css/amazeui.min.css">
	<link rel="stylesheet" href="${ctx}/assets/css/admin.css">
	<link rel="stylesheet" href="${ctx}/assets/css/app.css">
	
	<%@ include file="/jsp/jslib.jsp"%>
	<script type="text/javascript">
		var PAGE_CONFIG = {'MENU_INDEX' : 1,'LI_INDEX' : 1};
	</script>
	<script type="text/javascript" src="${ctx}/js/project.js"></script>
	
<script type="text/javascript">
	$(function(){
		project.ctx = "${ctx}";
		if("" != $('#error').val()){
			var $modal1 = $('#my-alert');
			$modal1.modal();
			return;
		}
		project.projectPage("1");
	}); 
	
</script>
	
</head>
<body>

<%@ include file="/jsp/banner.jsp"%>
<div class="am-cf admin-main">
	<%@ include file="/jsp/menu.jsp"%>
	
	<!-- content start -->
	<div class="admin-content">
		<div class="admin-content-body">
		
		<!-- ***** 分离出去 动态加载 start ***** -->
		
		<div class="am-g am-padd-top-20">
		    <div class="am-u-sm-12 am-u-md-6">查询条件</div>
		</div>
		<div class="am-g am-padd-top-20">
		    <div class="am-u-sm-12 ">
		      	<div class="am-btn-toolbar">
		            <div class="am-u-sm-12 am-u-md-4">项目名称：<input type="text" class="am-input-sm" name="projectName" id="projectName" value="${project.projectName }"></div>
		            <div class="am-u-sm-12 am-u-md-4">客户公司：
		            	<select  name="customerCompanyId" id ="customerCompanyId">
		                  	<option value="">请选择</option> 
		                  	<c:forEach items="${customerCompanyList }" var = "customerCompany" >
		            			<option value="${customerCompany.customerCompanyId }" <c:if test="${customerCompany.customerCompanyId == project.customerCompanyId}">selected</c:if>>${customerCompany.customerCompanyName }</option>
		            		</c:forEach>
		                </select>
		            </div>
		            <div class="am-u-sm-12 am-u-md-4">项目负责人：
						<select  name ="staffId1" id ="staffId1" <c:if test="${permission == 0}">disabled</c:if>>
		                    <option value="">请选择</option>
		                    <c:forEach items="${staffList }" var = "staff" >
		            			<option value="${staff.staffId }" <c:if test="${staff.staffId == project.staffId}">selected</c:if>>${staff.staffName }</option>
		            		</c:forEach>
		                </select>
					</div>
		            <div class="am-u-sm-12 am-u-md-4">合作厂商：<input type="text" class="am-input-sm" name ="partnerCompanyName" id ="partnerCompanyName" value="${project.partnerCompanyName }"></div> 
		            <div class="am-u-sm-12 am-u-md-4  am-u-end">项目状态：
		            	<select  name ="projectStatus" id ="projectStatus">
		            		<option value="">请选择</option>
		            		<c:forEach items="${projectStatus }" var = "status" >
		            			<option value="${status.key }" <c:if test="${status.key == project.projectStatus}">selected</c:if>>${status.value }</option>
		            		</c:forEach>
		                </select>
		            </div>
		        </div>
		    </div>
		</div>
		
		<div class="am-g am-padd-top-20">
            <div class="am-u-sm-12 am-u-md-12">
    			<button class="am-btn am-btn-default"  type="button" onclick="project.queryProjestList();">查询</button>
               <a href="${ctx}/project/projectAddFormPage" ><button type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span>创建项目机会 </button></a>
    			<!-- <button class="am-btn am-btn-default"  type="button" onclick="project.resetForm();">重置/清空</button> -->
    		</div>
    	</div>
		
		<hr/>
		
		<div class="am-g">
		    <div class="am-u-sm-12">
		        <form class="am-form">
		            <table class="am-table am-table-striped am-table-hover table-main am-u-sm-6">
		                <thead>
		                    <tr>
		                        <!-- <th class="table-check"><input type="checkbox" /></th> -->
		                        <th class="table-id">序号</th>
		                        <th class="table-title">项目名称</th>
		                        <!-- <th class="table-title">客户联系人</th> -->
		                        <th class="table-title">客户公司</th>
		                        <th class="table-title">项目负责人</th>
		                        <th class="table-title">合作厂家</th> 
		                        <!-- <th class="table-title">项目进度</th> -->
		                        <th class="table-title">项目状态</th>
		                        <!-- <th class="table-title">报价</th> -->
		                    </tr>
		                </thead>
		
		                <tbody id="tableList">
		                	<%-- <c:forEach items="${projectList}" var="project">
		                	<c:if test="${project.projectStatus == '1' || project.projectStatus == '2'}">
		                		<tr>
			                        <td>${project.projectId}</td>
			                        <td>
			                        	<c:if test="${project.projectStatus == '1'}"><a href="${ctx}/project/projectBeforeFormPage?projectId=${project.projectId}">${project.projectName}</a></c:if>
			                        	<c:if test="${project.projectStatus == '2'}"><a href="${ctx}/project/projectImplementFormPage?projectId=${project.projectId}">${project.projectName}</a></c:if>
			                        	<c:if test="${project.projectStatus == '3'}"><a href="${ctx}/project_implement_form.jsp">${project.projectName}</a></c:if>
			                        </td>
			                        <td>${project.customerCompanyName}</td>
			                        <td>${project.staffName}</td>
			                        <td>${project.partnerCompanyName}</td>
			                        <td>${project.projectStatusValue}</td>
		                        </tr>
		                        </c:if>
		                	</c:forEach> --%>
	                    </tbody> 
		            </table>
		
		            <!-- <div class="am-cf">
		                <div class="am-fr">
		                    <ul class="am-pagination">
		                        <li class="am-disabled"><a href="#">«</a></li>
		                        <li class="am-active"><a href="#">1</a></li>
		                        <li><a href="#">2</a></li>
		                        <li><a href="#">3</a></li>
		                        <li><a href="#">4</a></li>
		                        <li><a href="#">5</a></li>
		                        <li><a href="#">»</a></li>
		                    </ul>
		                </div>
		            </div> -->
		            <input type="hidden" id = "count" value="${count}">
		            <div class="am-cf">
			            <div  class="am-fr">
			            	<ul class="am-pagination" id="page"></ul>
			            </div>
		            </div>
		        </form>
		    </div>
		
		    </div>
		</div>
		
		<!-- ***** 分离出去 动态加载 end ***** -->
		<!-- 错误提示信息 -->
		<input type="hidden" id="error" value="${error}"/>
		<div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
		  <div class="am-modal-dialog">
		    <div class="am-modal-hd">错误信息</div>
		    <div id ="errorMsg" class="am-modal-bd">
		     ${error}
		    </div>
		    <div class="am-modal-footer">
		      <span class="am-modal-btn">确定</span>
		    </div>
		  </div>
		</div>
	</div>
	<!-- content end -->
</div>


</body>
</html>